<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8" />
    <title>下载记录-{eyou:global name='web_name' /}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <link href="{eyou:global name='web_cmspath'/}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    {eyou:static file="users/skin/css/eyoucms.css"/}
	<!-- 新样式 2020-11-25 -->
	{eyou:static file="users/skin/css/element/index.css" /}
	{eyou:static file="users/skin/css/e-user.css" /}
    {eyou:include file="users/skin/css/diy_css.htm"/}
    
    {eyou:static file="/public/static/common/js/jquery.min.js"/}
    {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
    {eyou:static file="/public/static/common/js/tag_global.js"/}
    {eyou:static file="/public/static/common/js/mobile_global.js"/}
</head>

<body>

{eyou:include file="users/users_header.htm" /}
    <!-- 头部信息 -->
	<div class="ey-header-status">
		<div class="header-status-l">
			<a href="{eyou:url link='user/Users/index'/}"><i class="el-icon-arrow-left"></i></a>
		</div>
		<div class="header-status-m">我的足迹</div>
		<div class="header-status-r">
            {eyou:notempty name="$list"}
			<span id="management-button">管理</span>
            {/eyou:notempty}
		</div>
	</div>
	<!-- 头部信息结束 -->
	<div class="h50"></div>
    {eyou:include file="users/users_footprint_header.htm" /}
	<div class="ey-container">
        {eyou:empty name="$list"}
        <div class="ey-con">
            <div class="ey-row min-hg-c-92 flex flex-center">
                <div class="tc mt-92">
                    <p class=""><img id='litpic_img' src="{eyou:static file='users/skin/images/null-data.png' /}"/></p>
                </div>
            </div>
        </div>
        {eyou:else/}
        <div class="ey-con min-hg-c-92 bgfff">
            <div class="ey-row ptb0">
            {eyou:volist name="$list" id="vo"}
                <div class="balances">
                    <div class="related-content mr5">
                        <label class="checkbox-label checkbox_z">
                            <span> &nbsp; </span>
                            <input class="checkbox" type="checkbox" name="ids[]" value="{$vo.log_id}">
                            <span class="check-mark"></span>
                        </label>
                    </div>
                    <a class="balances-pic" href="{$archivesList[$vo['aid']]['arcurl']|default='javascript:void(0);'}">
                        {eyou:empty name="$archivesList[$vo['aid']]['litpic']" /}
                        <img class="pic" src="__PUBLIC__/static/common/images/not_adv.jpg"> 
                        {eyou:else /}
                        <img class="pic" src="{$archivesList[$vo['aid']]['litpic']}">
                        {/eyou:empty}
                    </a>
                    <a class="balances-info" href="{$archivesList[$vo['aid']]['arcurl']|default='javascript:void(0);'}">
                        <div class="title fs15">
                            <span>{$archivesList[$vo['aid']]['title']|default='<font color="red">该文档已被删除！</font>'}</span>
                        </div>
                        <div>
                            <span>{$vo.add_time|date='Y-m-d H:i',###}</span>
                        </div>
                    </a>
                </div>
            {/eyou:volist}
            </div>
            {$page}
            <div class="foot-batch related-content">
                <div class="mr5">
                    <label class="checkbox-label checkbox_z">
                        <input class="checkbox" type="checkbox" onclick="javascript:$('input[name*=ids]').prop('checked',this.checked);">
                        <span class="check-mark"></span>
                        <span class="ml5">全选</span>
                    </label>
                </div>
                <div class="fr">
                    <a class="addr_y" href="javascript:void(0);" onclick="BatchDelData(this, 'ids');" data-url="{$delurl}">批量删除</a>
                </div>
            </div>
        </div>
        {/eyou:empty}
	</div>
    <script type="text/javascript">
        // 管理相关
        const managementButton = $('#management-button');
        const relatedContent = $('.related-content');
        function handleClick() {
          if (relatedContent.is(':hidden')) {
            relatedContent.show();
            managementButton.text('完成');
          } else {
            relatedContent.hide();
            managementButton.text('管理');
          }
        }
        managementButton.on('click', handleClick);
        // 批量删除足迹
        function BatchDelData(obj, name) {
            var a = [];
            $('input[name^='+name+']').each(function(i,o){
                if($(o).is(':checked')){
                    a.push($(o).val());
                }
            })
            if(a.length == 0){
                showErrorAlert('请至少选择一项！');
                return false;
            }
            // 删除按钮
            layer.confirm('确认批量删除下载记录？', {
                title: false,
                skin: 'xin-demo-btn',
                btn: [ey_foreign_system2, ey_foreign_system3], //按钮
                closeBtn: 0,
                shadeClose: true
            }, function () {
                layer_loading('正在处理');
                $.ajax({
                    type: "POST",
                    url: $(obj).attr('data-url'),
                    data: {del_id:a},
                    dataType: 'json',
                    success: function (res) {
                        layer.closeAll();
                        if(res.code == 1){
                            layer.msg(res.msg, {icon: 1});
                            window.location.reload();
                        }else{
                            showErrorAlert(res.msg);
                        }
                    },
                    error:function(e){
                        layer.closeAll();
                        showErrorAlert(e.responseText);
                    }
                });
            }, function (index) {
                layer.closeAll(index);
            });
        }
    </script>
<!-- END -->